import { defineStore } from 'pinia'
import { AddUser } from '../utils/trueType'
export const useAddUserStore = defineStore('addUser', {
    state: () => ({
        user:{
            id: '',
            username: '',
            password: '',
            realName: '',
            email: '',
            mobile: '',
            roleId: [],
            departmentId: '',
            positionId: '',
            status: 0,
            time: ''
        } as  AddUser,
        isOpen: false
    }),
    actions: {
        setUser(user:AddUser){
            this.user = user
        },
        setOpen(isOpen:boolean){
            this.isOpen = isOpen
        },
        setUserNull(){
            this.user = {
            id: '',
            username: '',
            password: '',
            realName: '',
            email: '',
            mobile: '',
            roleId: [],
            departmentId: '',
            positionId: '',
            status: 0,
            time: ''
        } as  AddUser
        }
    },
    getters: {
        
    },
}
)